const Users = () => import('@/views/users')
const List = () => import('@/views/users/list.vue')
const Edit = () => import('@/views/users/edit.vue')
const Profile = () => import('@/views/profile')
const Detail = () => import('@/views/profile/detail.vue')
const ChangePassword = () =>
  import('@/views/profile/changePassword')

const routes = [
  {
    path: '/',
    redirect: '/users',
    meta: {
      title: 'tiltle'
    }
  },
  {
    name: 'Users',
    path: '/users',
    redirect: '/users/list',
    component: Users,
    meta: {
      title: '用户管理'
    },
    children: [
      {
        name: 'List',
        path: 'list',
        component: List,
        meta: {
          title: '用户列表'
        }
      },
      {
        name: 'Edit',
        path: 'edit',
        component: Edit,
        meta: {
          title: '编辑用户'
        }
      }
    ]
  },
  {
    name: 'Profile',
    path: '/profile',
    redirect: '/profile/detail',
    component: Profile,
    meta: {
      title: '个人中心'
    },
    children: [
      {
        name: 'Detial',
        path: 'detail',
        component: Detail,
        meta: {
          title: '个人详情'
        }
      },
      {
        name: 'ChangePassword',
        path: 'changePassword',
        component: ChangePassword,
        meta: {
          title: '修改密码'
        }
      }
    ]
  }
]

export default routes
